package ToolsQA;

import java.io.File;
import java.io.FileInputStream;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

/**
 * Hello world!
 *
 */
public class App 
{
	@Test
    public void main()
    {
        System.out.println( "Hello World!" );
        WebDriver myD = new FirefoxDriver();
    }
	public String[][] readXL(String sPath, String iSheet) throws Exception{
		String[][] xData;   

		File myxl = new File(sPath);                                
		FileInputStream myStream = new FileInputStream(myxl);                                
		HSSFWorkbook myWB = new HSSFWorkbook(myStream);                                
		HSSFSheet mySheet = myWB.getSheet(iSheet);                                 
		xRows = mySheet.getLastRowNum()+1;                                
		xCols = mySheet.getRow(0).getLastCellNum();                                
		xData = new String[xRows][xCols];        
		for (int i = 0; i < xRows; i++) {                           
				HSSFRow row = mySheet.getRow(i);
				for (int j = 0; j < xCols; j++) {                               
					HSSFCell cell = row.getCell(j);                               
					String value = cellToString(cell);                               
					xData[i][j] = value;                               
					}        
				}                                      
		return xData;
	}
	
}
